#include "StdAfx.h"
#include "UIPropertySet.h"

typedef CEGUI::PropertySet::Iterator PropertySetIterator;

void PropertySetIterator_Next(PropertySetIterator* self)
{
	self++;
}

void PropertySetIterator_Previous(PropertySetIterator* self)
{
	self--;
}

void ScriptBackend::Module_UIPropertySet( lua_State* l )
{
	using namespace luabind;
	using namespace CEGUI;

	module(l)
		[
			class_<PropertySetIterator>("UIPropertySetIterator")
			.property("CurrentKey",&PropertySetIterator::getCurrentKey)
			.property("CurrentValue",&PropertySetIterator::getCurrentValue)
			.property("IsAtEnd",&PropertySetIterator::isAtEnd)
			.property("IsAtStart",&PropertySetIterator::isAtStart)
			.def("ToEnd",&PropertySetIterator::toEnd)
			.def("ToStart",&PropertySetIterator::toStart)
			.def("Next",&PropertySetIterator_Next)
			.def("Previous",&PropertySetIterator_Previous)
			.def(const_self == other<const PropertySetIterator&>())
			,
			class_<PropertySet>("UIPropertySet")
			.def("SetProperty",&PropertySet::setProperty)
			.def("GetProperty",&PropertySet::getProperty)
			.def("IsPropertyExists",&PropertySet::isPropertyPresent)
			.def("GetIterator",&PropertySet::getIterator)
		];
}